//
// Created by HLiamso on 2022-03-31.
//

#ifndef Detect
#define Detect
#include "Sys.h"
typedef enum
{
    IMU = 0,
    DBUS = 1,
    YAW_MOTOR = 2,
    PITCH_MOTOR = 3,
    CHASSIS_MOTOR = 4,
    FRICTION_MOTOR = 5,
    CLIP_MOTOR = 6,
    DEVICE_NUMBER,
}Device_List_t;
typedef enum
{
    Not_OK = 0,
    OK = 1,
}Device_Status_t;
typedef struct
{
    Device_Status_t Device_Status;
    float Last_Response_TimeLine;
    float No_Response_Time;
    float Tolerance_Time;
} Device_t;
extern Device_t DEVICES[DEVICE_NUMBER+1];
void Detect_Init();
void Detect_Task();
void Device_Activation(Device_List_t Device);
void Tolerance_Time_Init();
#endif //Detect
